import Vue from 'vue'
import Vuex from 'vuex'
import $ from 'jquery'
/**
 * @desc 导入需要的store
 * @author wtniu
 */
import store1 from './store1'
import store2 from './store2'
import store3 from './store3'
import store4 from './store4'
import store5 from './store5'

Vue.use(Vuex)

export default new Vuex.Store({
	state: {
		historyLength: 0
	},
	getters: {
		count: state => {
			return state.historyLength
		}
	},
	mutations: {
		/*
		 * @desc 记录路由切换次数
		 * @arg {object} state 状态
		 */
		updateHistoryLength(state) {
			state.historyLength++
		}
	},
	actions: {
		updateHistoryLength({
			commit
		}) {
			commit('updateHistoryLength')
		}
	},
	modules: {
		store1,
		store2,
		store3,
		store4,
		store5
	}
})